/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package prognosisdataalgo;

import java.text.DateFormatSymbols;

/**
 * @author ApT
 */
public abstract class PrognosisFunction {

    static String days[] = new DateFormatSymbols().getWeekdays();

    public double distance(LatLng StartP, LatLng EndP) {
        double lat1 = StartP.latitude;
        double lat2 = EndP.latitude;
        double lon1 = StartP.longitude;
        double lon2 = EndP.longitude;
        double dLat = Math.toRadians(lat2 - lat1);
        double dLon = Math.toRadians(lon2 - lon1);
        double a = Math.sin(dLat / 2) * Math.sin(dLat / 2)
                + Math.cos(Math.toRadians(lat1))
                * Math.cos(Math.toRadians(lat2)) * Math.sin(dLon / 2)
                * Math.sin(dLon / 2);
        double c = 2 * Math.asin(Math.sqrt(a));
        return 6366000 * c;
    }
}
